/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package toesp.entity;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;

/**
 *
 * @author satria.sp
 */
@Entity
@Table(name = "tha")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Tha.findAll", query = "SELECT t FROM Tha t")})
public class Tha implements Serializable {
    @OneToMany(mappedBy = "thaId")
    private List<Pendaftaran> pendaftaranList;
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "tha_id")
    private Integer thaId;
    @Column(name = "tha_tahun")
    private String thaTahun;
    @Column(name = "tha_semester")
    private Character thaSemester;
    @OneToOne(cascade = CascadeType.ALL, mappedBy = "tha")
    private ThaAktif thaAktif;
    @OneToMany(mappedBy = "tha")
    private List<Asisten> asistenList;
    @OneToMany(mappedBy = "tha")
    private List<Kuliahpt> kuliahptList;

    public Tha() {
    }

    public Tha(Integer thaId) {
        this.thaId = thaId;
    }

    public Integer getThaId() {
        return thaId;
    }

    public void setThaId(Integer thaId) {
        this.thaId = thaId;
    }

    public String getThaTahun() {
        return thaTahun;
    }

    public void setThaTahun(String thaTahun) {
        this.thaTahun = thaTahun;
    }

    public Character getThaSemester() {
        return thaSemester;
    }

    public void setThaSemester(Character thaSemester) {
        this.thaSemester = thaSemester;
    }

    public ThaAktif getThaAktif() {
        return thaAktif;
    }

    public void setThaAktif(ThaAktif thaAktif) {
        this.thaAktif = thaAktif;
    }

    @XmlTransient
    public List<Asisten> getAsistenList() {
        return asistenList;
    }

    public void setAsistenList(List<Asisten> asistenList) {
        this.asistenList = asistenList;
    }

    @XmlTransient
    public List<Kuliahpt> getKuliahptList() {
        return kuliahptList;
    }

    public void setKuliahptList(List<Kuliahpt> kuliahptList) {
        this.kuliahptList = kuliahptList;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (thaId != null ? thaId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Tha)) {
            return false;
        }
        Tha other = (Tha) object;
        if ((this.thaId == null && other.thaId != null) || (this.thaId != null && !this.thaId.equals(other.thaId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "toesp.entity.Tha[ thaId=" + thaId + " ]";
    }

    @XmlTransient
    public List<Pendaftaran> getPendaftaranList() {
        return pendaftaranList;
    }

    public void setPendaftaranList(List<Pendaftaran> pendaftaranList) {
        this.pendaftaranList = pendaftaranList;
    }
    
}
